/* virtualmem.h:
 *
 * Author: Will Lamond
 *
 * A wrapper for memory which abstracts away the mapping of logical addresses
 * to physical addresses.
 *
 */

#ifndef	_VMEM_H_
#define	_VMEM_H_

#include "glob.h"



typedef struct _VMEMMOD {
	MEMMOD *mm;
	int LRUpid, LRUpage; //the last recently used page and PID
	int pFs;
} VMEMMOD;

int initVMem(VMEMMOD **vm, char* brainpath);

int vmem_read(VMEMMOD *vm, size_t memLoc, char* box, int pid);

int vmem_store(VMEMMOD *vm, size_t memLoc, char value[4], int pid);

int pageIn(VMEMMOD *vm, int pageNum, int pid);

int pageOut(VMEMMOD *vm, int pageNum, int pid);

int getNumPages(VMEMMOD *vm, int pid);

#endif
